package com.rising.face.proxy.jdk;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class MyInvocationHandler implements InvocationHandler {
    private Sell sell;

    public MyInvocationHandler(Sell sell) {
        this.sell = sell;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("开始卖东西喽。。。。。。。。。。。");
        Object invoke = method.invoke(sell, args);
        System.out.println("卖完了，好开心。。。。。");
        return invoke;
    }

}
